package by.onlinernews.newslist;

import by.onlinernews.database.DB;
import android.content.Context;
import android.database.Cursor;
import android.support.v4.content.CursorLoader;
import android.util.Log;


public class NewsCursorLoader extends CursorLoader {

    DB db;
    int pageNumber;
    
    
    public NewsCursorLoader(Context context,int pageNumber, DB db) {
      super(context);
      this.db = db;
      this.pageNumber=pageNumber;

    }

	@Override
    public Cursor loadInBackground() {
    	
      Log.d("myLogs", "load cursor number "+ pageNumber);
      Cursor cursor = db.getAllData(pageNumber);      
      return cursor;
    }
    
  }
